import { ElMessage } from 'element-plus'

export const useCopy = (text: string) => {
  const input = document.createElement('input')
  input.value = text
  document.body.append(input)
  input.select()
  document.execCommand('Copy')
  document.body.removeChild(input)

  ElMessage.success('复制成功')
}
